  function createReader(cb) {
    return function(event) {
      const file = event.target.files[0];
      const fr = new FileReader();
      fr.onload = function() {
        var img = new Image();
        img.src = fr.result;
        cb(img);
      }
      fr.readAsDataURL(file);
      console.log("fr=",fr);
    }
  }

  function readImage(img){
    const imgdiv = document.querySelector("[data-error=img]");
    imgdiv.innerHTML = "";
    imgdiv.insertAdjacentElement("afterbegin", img);
    console.log(imgdiv)
    // console.log(imgdiv.firstChild.src)
  }
